  <?php
 include('connectDB.php');
include '../template/header.php';
include '../template/menuleft.php';
include '../template/menuright.php';
?>
 
   <div class="viewct" >
	<center><form action="timkiem.php" method="post">
    	<label>Nhập mã sinh viên:</label><input type="text" name="keyword" placeholder="--Mã sinh viên--" />
        <input type="submit" value="Tìm"   />  </form></center>
   <div class="title">Danh Sách Tìm Được</div> 
   <div class="tb">
           <table border="1" cellpadding="0" cellspacing="0" style="font-size:12px; font-family:Arial, Helvetica, sans-serif;">
               <tbody>
               <tr><th >STT</th><th>Mã SV</th><th>Họ Tên</th>
                   <th>Ngày Sinh</th><th>Giới Tính</th><th>Lớp</th>
                   <th>Khoa</th><th>Số CM</th><th colspan="2">Action</th></tr> 

<?php
	
	$ma=$_POST['keyword'];
	$sql_getall="select * from sinhvien join sinhvien_phong on sinhvien.masv=sinhvien_phong.masv where sinhvien.masv='$ma'";
	$r=mysql_query($sql_getall);	
				 	$i=0;					
					while($nr=mysql_fetch_array($r))
					{
						
						$i++;
						if ($i%2==0)
						{
							
				 ?>                 
                <tr style="background:#FFC;">
                	<td> <?php echo $i;?></td>
                    <td class="style1" >
                    <a href='./?mod=sinhvien&do=dssv&pro_ID=<?php echo $nr['masv'];?>'><?php echo $nr['masv']; ?></a></td>
                    <td ><?php echo $nr['hoten'];?></td>
                    <td><?php echo $nr['ngaysinh'];?></td>
                    <td><?php if ($nr['gioitinh']==0 ){echo"Nữ";}else {echo "Nam";} ?></td>
                    <td><?php echo $nr['lop'];?></td>
                    <td><?php echo $nr['khoa'];?></td>
                    <td><?php echo $nr['socm'];?></td>                                                   
                </tr>
               
               <?php }else
			   			{
							?>
				<tr style=" background:#CCC;">
                    <td> <?php echo $i;?></td>
                    <td class="style1" >
                    <a href='./?mod=sinhvien&do=dssv&sv_ID=<?php echo $nr['masv'];?>'><?php echo $nr['masv']; ?></a></td>
                    <td ><?php echo $nr['hoten'];?></td>
                    <td><?php echo $nr['ngaysinh'];?></td>
                    <td><?php if ($nr['gioitinh']==0 ){echo"Nữ";}else {echo "Nam";} ?></td>
                    <td><?php echo $nr['lop'];?></td>
                    <td><?php echo $nr['khoa'];?></td>
                    <td><?php echo $nr['socm'];?></td>                                                  
                </tr>
                <?php
						}
			   			
					}
					?>
              </tbody>
           </table> 
           </div>    
  </div>
   
 
<?php include '../template/footer.php';?>                                			